import * as ajax from "../../common/ajax";
import axios from 'axios';

export const list = () => ajax.pureGet("/student/course/list");

export const deleteItem = studentCourseId =>
  ajax.pureDelete("/student/course/" + studentCourseId);

const apiClient = axios.create({
  baseURL: 'http://localhost:8080/api',  // 根据后端服务器地址和端口号进行调整
  timeout: 1000
});

// 获取课程详情 API
export function getCourseDetail(courseId) {
  return apiClient.get(`/course/${courseId}`);
}
// 前端发送的请求
axios.get(`/student/course/${courseId}`)  // 确保 courseId 传入正确
